package cn.momoshenchi.medicine.pojo;

import cn.momoshenchi.medicine.enumerate.Add;
import cn.momoshenchi.medicine.enumerate.Update;
import com.baomidou.mybatisplus.annotation.*;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName base_organization
 */
@TableName(value ="base_organization")
public class BaseOrganization implements Serializable {
    /**
     * 
     */
    @TableId
    @Null(groups = Add.class)
    @NotNull(message = "机构id不能为空",groups = Update.class)
    private String organizationId;

    /**
     * 机构名称
     */
   @NotBlank(message = "机构名称不能为空",groups = Add.class)
    private String organizationName;

    /**
     * 机构地址
     */
    @NotBlank(message = "机构地址不能为空",groups = Add.class)
    private String organizationAddr;

    /**
     * 联系方式
     */
    @NotBlank(message = "联系方式不能为空",groups = Add.class)
    private String organizationPhoneNo;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 
     */
    public String getOrganizationId() {
        return organizationId;
    }

    /**
     * 
     */
    public void setOrganizationId(String organizationId) {
        this.organizationId = organizationId;
    }

    /**
     * 机构名称
     */
    public String getOrganizationName() {
        return organizationName;
    }

    /**
     * 机构名称
     */
    public void setOrganizationName(String organizationName) {
        this.organizationName = organizationName;
    }

    /**
     * 机构地址
     */
    public String getOrganizationAddr() {
        return organizationAddr;
    }

    /**
     * 机构地址
     */
    public void setOrganizationAddr(String organizationAddr) {
        this.organizationAddr = organizationAddr;
    }

    /**
     * 联系方式
     */
    public String getOrganizationPhoneNo() {
        return organizationPhoneNo;
    }

    /**
     * 联系方式
     */
    public void setOrganizationPhoneNo(String organizationPhoneNo) {
        this.organizationPhoneNo = organizationPhoneNo;
    }

    /**
     * 创建时间
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 创建时间
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        BaseOrganization other = (BaseOrganization) that;
        return (this.getOrganizationId() == null ? other.getOrganizationId() == null : this.getOrganizationId().equals(other.getOrganizationId()))
            && (this.getOrganizationName() == null ? other.getOrganizationName() == null : this.getOrganizationName().equals(other.getOrganizationName()))
            && (this.getOrganizationAddr() == null ? other.getOrganizationAddr() == null : this.getOrganizationAddr().equals(other.getOrganizationAddr()))
            && (this.getOrganizationPhoneNo() == null ? other.getOrganizationPhoneNo() == null : this.getOrganizationPhoneNo().equals(other.getOrganizationPhoneNo()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getOrganizationId() == null) ? 0 : getOrganizationId().hashCode());
        result = prime * result + ((getOrganizationName() == null) ? 0 : getOrganizationName().hashCode());
        result = prime * result + ((getOrganizationAddr() == null) ? 0 : getOrganizationAddr().hashCode());
        result = prime * result + ((getOrganizationPhoneNo() == null) ? 0 : getOrganizationPhoneNo().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", organizationId=").append(organizationId);
        sb.append(", organizationName=").append(organizationName);
        sb.append(", organizationAddr=").append(organizationAddr);
        sb.append(", organizationPhoneNo=").append(organizationPhoneNo);
        sb.append(", createTime=").append(createTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}